Starting Services Automatically for a Non-Root Installation

  • If ArcMC is installed as a non-root user, and the host is rebooted, ArcMC services will fail to start automatically. However, you can set them to start automatically by using an initialization script.

    Note: Since the initialization script runs as su, it does not log to the console.

    An example script is shown here. This is only an example. Your own script will need to be tailored for your environment.

    #!/bin/sh
    # ArcMC              Wrapper script for the Arcsight Management Center
    # processname:       arcsight_arcmc
    # chkconfig:         2345 99 01
    # description:       Arcsight Management Center
    DAEMON=/<install_dir>/current/arcsight/arcmc/bin/arcmcd
    DAEMON_USER=<NonRootUser-with-which-arcmc-was-installed>
    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0
    if [ $UID -ne 0 ] ; then
    echo "You must run this as root."
    exit 4
    fi
    su $DAEMON_USER -c "$DAEMON $1 $2"
    exit $?

    The DAEMON variable is used to specify the directory where arcmcd process is running.

    The DAEMON_USER variable is used to specify which non-root user ArcMC will run as.

    Finally, the su command simply wraps your existing script (defined in the variable DAEMON) and passes any parameters to the $DAEMON script/

    To configure an initialization script:

    1. SSH to the VM using root user credentials.
    2. Go to /etc/init.d
    3. Enter the command vi arcsight_arcmc to create a service.
    4. Enter the text of your script and save the file.
    5. Give execute permission for the script using the command chmod +x arcsight_arcmc
    6. Register the script using the command

    chkconfig –add arcsight_arcmc

    1. Enter the command chkconfig | grep arcsight_arcmc to determine what the chkconfig will report after you add the init script. Expected results:

    arcsight_arcmc 0:off 1:off 2:on 3:on 4:on 5:on 6:off